<!DOCTYPE HTML>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
	<head>
    <meta charset="UTF-8">
    <title th:text="${title}"></title>
    <link rel="stylesheet" type="text/css" th:href="@{{path}font-awesome/css/font-awesome.min.css(path=${contextPath})}"/>
    <link rel="stylesheet" type="text/css" th:href="@{{path}layui/2.3.0/css/layui.css(path=${contextPath})}"/>
    <script th:inline="javascript">
	var globalId=[[${id}]],metaData=[[${metaData}]],
	refMetaMap=metaData["refMetaMap"],mainMetaId=metaData["id"],
	mainMeta=refMetaMap[mainMetaId],
	refEnumMap=metaData["refEnumMap"],
	attrs=mainMeta["attrs"],contextPath=[[${contextPath}]],
	jsfile=[[${jsfile}]]||attrs["jsfile"];
	</script>
    <script>
    function $import(expr){
    	var array=expr.split(",");
    	for(var i in array){
    	var folders=array[i].split(".");
    	var url=contextPath;
    	for(var i in folders){
    		if(i>0){
    			url+="/";
    		}
    		var f=folders[i];
    		url+=f;
    	}
    	url+=".js";
    	document.write('<script type="text/javascript" src="' + url + '"' +(true ? ' defer' : '') + "><\/script>");
    	}
    }
    function $importCss(expr){
    	var array=expr.split(",");
    	for(var i in array){
    		var folders=array[i].split(".");
        	var url=contextPath;
        	for(var i in folders){
        		if(i>0){
        			url+="/";
        		}
        		var f=folders[i];
        		url+=f;
        	}
        	url+=".css";
        	document.write('<link rel="stylesheet" type="text/css" href="' + url + '"/>');
    	}
    	
    }
    (function() {
        function getQueryParam(name) {
            var regex = RegExp('[?&]' + name + '=([^&]*)');

            var match = regex.exec(location.search) || regex.exec(scriptPath);
            return match && decodeURIComponent(match[1]);
        }

        function hasOption(opt, queryString) {
            var s = queryString || location.search;
            var re = new RegExp('(?:^|[&?])' + opt + '(?:[=]([^&]*))?(?:$|[&])', 'i');
            var m = re.exec(s);

            return m ? (m[1] === undefined || m[1] === '' ? true : m[1]) : false;
        }

        function loadCss(url) {
            document.write('<link rel="stylesheet" type="text/css" href="' + url + '"/>');
        }

        function loadScript(url, defer) {
            document.write('<script type="text/javascript" src="' + url + '"' +(defer ? ' defer' : '') + "><\/script>");
        };

        Ext = window.Ext || {};
		Ext.devMode = 0;

        var scriptEls = document.getElementsByTagName('script'),
            scriptPath = scriptEls[scriptEls.length - 1].src,
            rtl = getQueryParam('rtl'),
            themeName = (getQueryParam('theme') || 'triton').replace(/^([-A-Za-z]*)(.*)/, '$1'),
            includeCSS = !hasOption('nocss', scriptPath),
            useDebug = hasOption('debug'),
            hasOverrides = !hasOption('nooverrides', scriptPath) && !!{
                // TODO: remove neptune
                neptune: 1,
                triton: 1,
                classic: 1,
                gray: 1,
                'neptune-touch': 1,
                crisp: 1,
                'crisp-touch': 1
            }[themeName],
            i = 4,
            devMode = Ext.devMode,
            extDir = contextPath+"extjs6/",
            rtlSuffix = (rtl ? '-rtl' : ''),
            debugSuffix = (devMode ? '-debug' : ''),
            cssSuffix = rtlSuffix + debugSuffix + '.css',
            themePackageDir, chartsJS, d3JS, uxJS, themeOverrideJS, extPrefix, extPackagesRoot;

        rtl = rtl && rtl.toString() === 'true';
        extDir=contextPath+"extjs6/";

        extPackagesRoot = devMode ? (extDir + '/build') : extDir;

        uxJS = extPackagesRoot + '/packages/ux/classic/ux' + debugSuffix + '.js';
        chartsJS = extPackagesRoot + '/packages/charts/classic/charts' + debugSuffix + '.js';
        d3JS = extPackagesRoot + '/packages/d3/classic/d3' + debugSuffix + '.js';
        themePackageDir = extPackagesRoot + '/classic/theme-' + themeName + '/';

        if (includeCSS) {
            loadCss(themePackageDir + 'resources/theme-' + themeName + '-all' + cssSuffix);
            loadCss(extPackagesRoot + '/packages/charts/classic/' + themeName + '/resources/charts-all' + cssSuffix);
            loadCss(extPackagesRoot + '/packages/ux/classic/' + themeName + '/resources/ux-all' + cssSuffix);
            if (Ext.devMode === 2) {
                loadCss(extPackagesRoot + '/packages/d3/classic/' + themeName + '/resources/d3-all' + cssSuffix);
            }
        }

        extPrefix = useDebug ? '/ext-all-debug' : '/ext-all';
        
        document.write('<script type="text/javascript" src="' + extDir + extPrefix + rtlSuffix + '.js"><\/script>');

        if (hasOverrides) {
            themeOverrideJS = themePackageDir + 'theme-' + themeName + debugSuffix + '.js';

            if (devMode) {
                if (window.ActiveXObject) {
                    Ext = {
                        _beforereadyhandler: function() {
                            Ext.Loader.loadScript({url: themeOverrideJS});
                        }
                    };
                } else {
                    loadScript(themeOverrideJS, true);
                }
            } else {
                loadScript(themeOverrideJS, true);
                loadScript(uxJS);
                loadScript(chartsJS);
                if (Ext.devMode === 2) {
                    loadScript(d3JS);
                }
            }
        };
        $import("extjs6.classic.locale.locale-zh_CN");
        $import(jsfile);
    })();
    </script>
    
    
    </head>
    <body>
    </body>
</html>
